//
//  BMWShareCollectionViewCell.swift
//  BMWOpenShare
//
//  Created by Li Shengbing, (Shengbing.Li@partner.bmw.com) on 2019/6/5.
//  Copyright © 2019年 shanghai. All rights reserved.
//

import UIKit

class BMWShareCollectionViewCell: UICollectionViewCell {
    
    fileprivate lazy var collectionView: BMWContentCollectionView = BMWContentCollectionView(frame: CGRect.zero, collectionViewLayout: UICollectionViewFlowLayout())
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView.addSubview(collectionView)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        collectionView.frame = self.contentView.bounds
    }
    
    func configCellWithIndexPath(rowDatas: [BMWShareModel]?, indexPath: IndexPath) {
        guard let tempRowDatas =  rowDatas else { return }
        self.collectionView.rowDatas = tempRowDatas
        self.collectionView.horizontalIndexPath = indexPath
    }
}
